package com.jx.medical.service.impl;

import com.jx.medical.mapper.AdminMapper;
import com.jx.medical.pojo.Factory;
import com.jx.medical.pojo.Instorage;
import com.jx.medical.pojo.Medicine;
import com.jx.medical.service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @author jx
 * @date Created on 2020/12/4  10:23
 **/
@Service
public class AdminServiceImpl implements AdminService {

    @Autowired
   private AdminMapper adminMapper;
    @Override
    public int insertMedicine(Medicine medicine) {
        int i = adminMapper.insertMedicine(medicine);
        return i;
    }

    @Override
    public Medicine getMedicineBymedId(int medId) {
        Medicine medicineBymedId = adminMapper.getMedicineBymedId(medId);
        return medicineBymedId;
    }

    @Override
    public int updateMedStorage(int medId, int medStorage) {
        int i = adminMapper.updateMedStorage(medId, medStorage);
        return i;
    }

    @Override
    public int insertInstorage(Instorage instorage) {
        int i = adminMapper.insertInstorage(instorage);
        return i;
    }

    @Override
    public int updateMedicine(Medicine medicine) {
        int i = adminMapper.updateMedicine(medicine);
        return i;
    }

    @Override
    public int deleteMedicine(int medId) {
        int i = adminMapper.deleteMedicine(medId);
        return i;
    }

    @Override
    public int insertFactory(Factory factory) {
        int i = adminMapper.insertFactory(factory);
        return i;
    }

    @Override
    public Factory getFactoryByfactoryId(int factoryId) {
        Factory factoryByfactoryId = adminMapper.getFactoryByfactoryId(factoryId);
        return factoryByfactoryId;
    }

    @Override
    public int updateFactory(Factory factory) {
        int i = adminMapper.updateFactory(factory);
        return i;
    }

    @Override
    public int deleteFactory(int factoryId) {
        int i = adminMapper.deleteFactory(factoryId);
        return i;
    }


}
